<!doctype html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/redmond/jquery-ui.css" rel="stylesheet" type="text/css" charset="utf-8" />    
        <link href="/home/static/ui.jqgrid.css" rel="stylesheet" type="text/css" charset="utf-8" />    
        <link href="/home/static/biblebeaters.css" rel="stylesheet" type="text/css" charset="utf-8" />  
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
        <script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script>
    </head>
    <body>
        <div class="wrapper">
            {{if user_name:}}
            <div id="logged-in-name"><small>Hello,</small><br/>{{=first_name}}<br/></div>
            <div class="invite-button"><img src="/home/static/invite.png" /></div>
            <dl id="image-map"> 
                <dd><a id="witness-button" class="button section" title="" href="#"></a></dd> 
                <dd><a id="bless-button" class="button section" title="" href="#blessing-chooser" rel="facebox"></a></dd> 
                <dd><a id="encourage-button" class="button section" title="" href="#"></a></dd> 
                <dd><div id="logo" title="" class="section" href="#"></div></dd> 
                <dd><div id="activity-level-frame" title="" class="section" href="#"></div></dd> 
                <dd><div id="activity-level-contents" title="" class="section" href="#"><img src="/home/static/status-{{=my_status}}.png" /></div></dd> 
                <dd><div id="points" title="" class="section" href="#">{{=my_points}}</div></dd> 
            </dl> 
            <table class="history"></table>
            <img id="logo-description" src="/home/static/logo-description.png" />
            <img id="activity-description" src="/home/static/activity-description.png" />
            <div id="blessing-chooser" style="display:none">
                <div style="margin:-10px;height:30px; width: 700px; background-color:#627aad"></div>
                <div style="padding-top:35px;height:400px;" class="blessing-chooser-contents">
                    <center><p>Click the gift below that you want to buy for a friend.</p></center>
                    <div class="flower" style="position:absolute;top:180px;left:60px">
                        <div class="flower-image" style="width:128px;height:128px;" ></div>
                        <p><b>100 Points</b><br/>A flower, freshly clicked.</p>
                    </div>
                    <div class="turtle" style="position:absolute;top:180px;left:280px">
                        <div class="turtle-image" style="width:128px;height:128px;"></div>
                        <p><b>1,000 Points</b><br/>Friendly turtle, we promise.</p>
                    </div>
                    <div class="car" style="position:absolute;top:180px;left:520px">
                        <div class="car-image" style="width:128px;height:128px;"></div>
                        <p><b>10,000 Points</b><br/>66` Chevy, sweet ride.</p>
                    </div>
                </div>
            </div>
            <div class="bookmark">
                <div>
                    <fb:serverFbml>
                       <script type="text/fbml">
                            <fb:fbml>
                                <br/><br/><br/><br/>
                                <center><fb:bookmark></fb:bookmark></center>
                            </fb:fbml>
                        </script>    
                    </fb:serverFbml>
                </div>
            </div>
            <script type="text/javascript">
            FB_RequireFeatures(["XFBML","Api"],function(){ FB.init("{{=FacebookConnect.api_key}}","home/static/xd_receiver.htm",null) });
            var used_witness_quota = {{='true' if used_witness_quota else 'false'}};
            var used_encouragement_quota = {{='true' if used_encouragement_quota else 'false'}};
            var host = '{{=request.env.http_host}}';
            var uid = '{{=uid}}';
            var mydata = {{=XML(
                history, 
                sanitize=False,
                permitted_tags=['br/','img/'],
                allowed_attributes={'img':['src']}
            )}};
            var has_new_incoming_activity = false;            
            var app_name = '{{=request.facebook.app_name}}';
            var friends_that_have_biblebeaters = "{{=''.join([str(x)+',' for x in friends_that_have_biblebeaters])}}";
            var my_points = {{=my_points}};
            window.onload = function() {
            {{if attempted_witness and used_witness_quota and problem_sending_message:}}    
            showWitnessQuotaUsedUp(); 
            {{elif attempted_encourage and used_encouragement_quota and problem_sending_message:}}    
            showEncourageQuotaUsedUp();
            {{elif problem_sending_message:}}    
            showProblemSending();    
            {{elif sent_message:}}
            showSuccessfullySent();
            {{pass}}}
            var uservoiceOptions = {
                key:"biblebeaters",
                host:"biblebeaters.uservoice.com",
                forum:"48079",
                alignment:"left",
                background_color:"#0022ff",
                text_color:"white",
                hover_color:"#1e99f7",
                lang:"en",
                showTab:true
            };        
            </script>          
            <link href="/home/static/facebox/facebox.css" rel="stylesheet" type="text/css"/>  
            <script type="text/javascript" src="/home/static/jquery.jqGrid.min.js"></script>
            <script type="text/javascript" src="/home/static/facebox/facebox.js"></script>
            <script type="text/javascript" src="/home/static/biblebeaters.js"></script>  
            {{elif login_url:}}
            {{=login_url}}
            {{pass}}
        </div>
    </body>
</html>
